{%extends "base.html"%}

{%block title%}
        <title>Administracion - Crear Periodo</title>
{%endblock title%}

{%block extrajs%}
    <script>
    $(function (){
        $("#id_fecha").datepicker({dateFormat:"dd/mm/yy"});
        $("#id_fecha_inicio").datepicker({dateFormat:"dd/mm/yy"});
        $("#id_fecha_fin").datepicker({dateFormat:"dd/mm/yy"});
    });
    </script>
{%endblock%}

{%block maincontent%}
<h2>Crear Periodo</h2>
<br>
<form class="form-vertical" method="POST">
    <fieldset>
    <div class="control-group">
    {%csrf_token%}
    {% for hidden in form.hidden_fields %}
        {{ hidden }}
    {% endfor %}

    {% for field in form.visible_fields %}
    <div class="control-group {%if field.errors%}error{%endif%}" {%if field.name == 'fecha_fin' or field.name == 'fecha_inicio' or field.name == "hora_inicio" or field.name == "hora_fin"%}style="display:inline-block; vertical-align:top;"{%endif%}>
        {{ field.errors }}
        <label for="id_{{field.name}}" class="control-label"><strong>{{ field.label }}</strong></label>
        <div class="controls">
        {{ field }}
        {%if field.help_text%}
            <p class="help-block">{{field.help_text}}</p>
        {%endif%}
        </div>
    </div>
    {%if field.name == "hora_fin" or field.name == "fecha_fin"%}
    <br>
    {%endif%}
    {% endfor %}

    <input type="submit" value="Guardar" class="btn btn-success"/> 
    <input type="submit" name="add_another" value="Guardar y agregar otro" class="btn btn-success"/> 
    <a class="btn btn-inverse" href="{%url admon.views.periodo_list%}">Cancelar</a>


    </fieldset>
</form>



{%endblock%}
